package com.mall.czlr.app.util;

import com.mall.czlr.base.entity.UserContext;
import com.mall.czlr.base.exception.BaseException;
import com.mall.czlr.base.util.Assert;

public class Util {
    public static void checkAuth (UserContext userContext, Integer userTypeEnum) {
        if (userContext == null || !userContext.getUserType().equals(userTypeEnum)) {
            Assert.exception(BaseException.ERROR_NOT_ALLOWED, "无权操作");
        }
    }
}
